package com.sayimo.maker.activity.service.impl;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import com.sayimo.framework.exception.DaoException;
import com.sayimo.framework.exception.ServiceException;
import com.sayimo.maker.activity.dao.BaseMoldbabyDao;
import com.sayimo.maker.activity.service.BaseMoldbabyService;
import com.sayimo.maker.commons.Constant;

@Service(value="baseMoldbabyService")
public class BaseMoldbabyServiceImpl implements BaseMoldbabyService {
 
	@Autowired
	private BaseMoldbabyDao baseMoldbabyDao ;
	@Override
	public Map<String, Object> selectBaseMoldbabyIdentifier(HttpServletRequest request) throws ServiceException {
	
			Map<String, Object> resultMap = new HashMap<String, Object>();
			String identifier=request.getParameter("identifier");
			if(StringUtils.isEmpty(identifier)){//参数错误
				resultMap.put(Constant.STATUS, Constant.STATUS_ERROR);
				resultMap.put(Constant.ERROR, Constant.SYSTEM_REQUEST_PARAM_ERROR);
				return resultMap;
			}
			Map<String, Object> map=new HashMap<String, Object>();
			try {
				map=baseMoldbabyDao.selectBaseMoldbabyByidentifier(identifier);
				resultMap.put(Constant.DATA, map);
				resultMap.put(Constant.STATUS, Constant.STATUS_SUCCESS);
			} catch (DaoException e) {
				e.printStackTrace();
			}
			return resultMap;
		}
	}


